Function Reference

_FileReadToArray

Reads the specified file into an array.

#include <File.au3>
_FileReadToArray($sFilePath, $aArray)

 

Parameters

$sFilePath Path and filename of the file to be read.
$aArray     The array to store the contents of the file.

 

Return Value

Success: Returns a 1
Failure: Returns a 0
@Error: 0 = No error.
1 = Error opening specified file

 

Remarks

$aArray[0] will contain the number of records read into the array.

 

Related

_FileWriteFromArray

 

Example


#include <file.au3>
Dim $aRecords
If Not _FileReadToArray("error.log",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    Msgbox(0,'Record:' & $x, $aRecords[$x])
Next